package com.jeremyaburns.oddio.tracker
{
	import com.jeremyaburns.oddio.tracker.OddioTracker;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	[SWF(width='800', height='600', backgroundColor='#000000', frameRate='30')]
	public class Main extends Sprite 
	{
		private var trackerApp :OddioTracker;
		
		// Entry point to the SWF.
		public function Main():void 
		{
			// Don't scale the stage. We'll resize the app on stage resize.
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;			
			stage.addEventListener( Event.RESIZE, stage_resize );
			
			// Create the app and add it to the display list.
			trackerApp = new OddioTracker( 800, 600 );
			addChild( trackerApp );
		}
		
		// We're running an OddioTracker at full stage size, so resize
		// the application when the stage gets resized.
		private function stage_resize( e:Event ) :void
		{
			trackerApp.resize( stage.stageWidth, stage.stageHeight );
		}
	}
}